package shared.highcharts.config

import dataclass.data
import java.lang.{ Integer => JInt, Double => JDouble, Boolean => JBoolean }


@data class BoxplotOption(
                     fillColor: Option[String],
                     lineWidth: Option[Double],
                     medianColor: Option[String],
                     medianWidth: Option[Double],
                     stemColor: Option[String],
                     stemDashStyle: Option[String],
                     stemWidth: Option[Double],
                     whiskerColor: Option[String],
                     whiskerLength: Option[String],
                     whiskerWidth: Option[Double],
                   )

object BoxplotOption {
  def apply(
             fillColor: String = null,
             lineWidth: JDouble = null,
             medianColor: String = null,
             medianWidth: JDouble = null,
             stemColor: String = null,
             stemDashStyle: String = null,
             stemWidth: JDouble = null,
             whiskerColor: String = null,
             whiskerLength: String = null,
             whiskerWidth: JDouble = null,
           ) = new BoxplotOption(
    Option(fillColor),
    Option(lineWidth).map(x => x: Double),
    Option(medianColor),
    Option(medianWidth).map(x => x: Double),
    Option(stemColor),
    Option(stemDashStyle),
    Option(stemWidth).map(x => x: Double),
    Option(whiskerColor),
    Option(whiskerLength),
    Option(whiskerWidth).map(x => x: Double),
  )
}
